<#include "/WEB-INF/default/fragment/nev.ftl">
<div id="main">
    <div align="center"><img src="./assets/image/logo.png" alt=""></div>
</div>
<div class="invit">
    <span>创建或修改1605团队</span>
    <div class="invit_btn">
        <button class="btn btn-danger">我的团队</button>
        <button class="btn btn-success" type="submit">保存</button>
    </div>
    <div id="main" class="create-team">
        <form class="form-horizontal" 
            action="${request.contextPath}/team_create.action?team.id=<#if team?? && team.id??>${team.id}</#if>" method="post">
            <div class="form-group clearfix post-list">
                <label class="post-name fl">团队名称</label>
                <div class="post-value fl">
                    <input type="text" class="form-control" id="inputPassword" name="team.name" 
                    value="<#if team?exists && team.name? exists>${team.name}</#if>">
                    <p class="post-massage">
                        <span class="mage-h">EX:</span> java1605
                    </p>
                    <#if fieldErrors?exists && fieldErrors['team.name']?exists>
                      <p class="help-block"><span class="text-danger">${fieldErrors['team.name']}</span></p>
                    </#if>
                </div>
            </div>
            <div class="form-group clearfix post-list">
                <label class="post-name fl">团队描述</label>
                <div class="post-value fl">
                    <input type="text" class="form-control" id="inputPassword" name="team.desc" 
                    value="<#if team?exists && team.desc? exists>${team.desc}</#if>">
                    <p class="post-massage">
                        <span class="mage-h">EX:</span> 如 java 专业第1605实训部
                    </p>
                </div>
            </div>
            <div class="form-group clearfix post-list">
                <label class="post-name fl">个性域名</label>
                <div class="post-value fl">
                    <div class="input-group">
                        <div class="input-group-addon">/team-</div>
                        <input type="text" class="form-control" id="exampleInputAmount" name="team.subdomain" 
                        value="<#if team?exists && team.subdomain? exists>${team.subdomain}</#if>">
                    </div>
                    <p class="post-massage">
                        可以使用个性域名访问该团队地址。默认为 /team-{team_id} ，创建之后不能修改。
                    </p>
                </div>
            </div>
            <div class="form-group clearfix post-list">
                <label class="post-name fl">团队介绍</label>
                <div class="post-value fl">
                    <textarea type="password" class="form-control" id="inputPassword" name="team.intro" 
                        value="<#if team?exists && team.intro? exists>${team.intro}</#if>"></textarea>
                    <p class="post-massage">
                        富文本介绍，可以制作个性化的团队页面
                    </p>
                </div>
            </div>
            <div class="form-group clearfix post-list">
                <label class="post-name fl">开始日期</label>
                <div class="post-value fl">
                    <div class="input-group">
                        <input type="text" class="form-control" id="startDate" name="team.gmtBegin" 
                            value="<#if team?exists && team.gmtBegin? exists>${team.gmtBegin}</#if>">
                        <div class="input-group-addon"></div>
                    </div>
                    <p class="post-massage">
                        团队开始的日期
                    </p>
                </div>
            </div>
            <div class="form-group clearfix post-list">
                <label class="post-name fl">结束日期</label>
                <div class="post-value fl">
                    <div class="input-group">
                        <input type="text" class="form-control" id="endDate" name="team.gmtEnd" 
                            value="<#if team?exists && team.gmtEnd? exists>${team.gmtEnd}</#if>">
                        <div class="input-group-addon"></div>
                    </div>
                    <p class="post-massage">
                        团队预期结束的日期
                    </p>
                </div>
            </div>
            <div class="form-group clearfix post-list">
                <label class="post-name fl">团队状态</label>
                <div class="post-value fl">
                    <ul class="list-group">
                        <li class="list-group-item" name="team.status" value="1">尚未开始</li>
                        <li class="list-group-item" name="team.status" value="2">正在实训中</li>
                        <li class="list-group-item" name="team.status" value="3">毕业项目实战</li>
                        <li class="list-group-item" name="team.status" value="4">完成实训</li>
                        <li class="list-group-item" name="team.status" value="5">结束团队</li>
                    </ul>
                    <script type="text/javascript">
                        $('.list-group>li').click(function(event) {
                            $('.list-group>li').removeClass('color-chick')
                            $(this).addClass('color-chick');
                        });
                    </script>
                    <p class="post-massage">
                            状态值只能从左往右顺序设置，不能倒序操作。
                    </p>
                    <p class="post-massage">
                        <span class="mage-h">EX:</span>已进入“毕业项目实战”阶段的团队不能再次回到“正在实训中”状态
                    </p>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    (function(config) {
      $('#startDate').datetimepicker(config);
      $('#endDate').datetimepicker(config);
    })({
      format: 'YYYY-MM-DD', 
      icons: {
        time: "fa fa-clock-o",
        date: "fa fa-calendar",
        up: "fa fa-arrow-up",
        down: "fa fa-arrow-down"
      }
    });
    </script>
</script>
<#include "/WEB-INF/default/fragment/footer.ftl"><#-- 团队创建页面 -->